const pool = require("./mysql");

const query = (sql, val = []) => {
  return new Promise((resolve, reject) => {
    pool.query(sql, val, (err, result) => {
      if (err) {
        reject(err);
      } else {
        resolve(result);
      }
    });
  });
};

module.exports = query;